package collection;

public class UnOrdTreeNode<E> extends ATreeNode<E> {

	private UnOrdTreeNode<E> parent;
	private SLinkedList<UnOrdTreeNode<E>> children;
	
	UnOrdTreeNode(E element)
	{
		super(element);
		this.children = new SLinkedList<UnOrdTreeNode<E>>();
	}
	
	UnOrdTreeNode<E> getParent()
	{
		return this.parent;
	}
	
	void setParent(UnOrdTreeNode<E> parent)
	{
		this.parent = parent;
	}
	
	SLinkedList<UnOrdTreeNode<E>> getChildren()
	{
		return this.children;
	}
	
	void setChildren(SLinkedList<UnOrdTreeNode<E>> children)
	{
		this.children = children;
	}
	
	void addChild(UnOrdTreeNode<E> child)
	{
		this.children.addLast(this.children.createNode(child));
	}
	
	@Override
	public void clear()
	{
		super.clear();
		this.children = null;
	}
}
